package com.famdoc.Controller;

import com.famdoc.Pojo.dto.Result;
import com.famdoc.Service.CrowdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 人群分类模块
 */
@RestController
@RequestMapping("/crowd")
public class CrowdController {

    @Autowired
    private CrowdService crowdService;

    /**
     * 获取所有人群分类
     * @return
     */
    @GetMapping("/getAllCrowd")
    public Result getAllCrowd(){
        return crowdService.getAllCrowd();
    }

    /**
     * 获取人群分类(通过人群分类名，用逗号分隔)
     * @param crowds
     * @return
     */
    @GetMapping("/getCrowd")
    public Result getCrowd(String crowds){
        return crowdService.getCrowd(crowds);
    }
}
